package com.situ.web.service.impl;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import com.situ.web.dao.IBanjiDao;
import com.situ.web.dao.impl.BanjiDaoImpl;
import com.situ.web.entity.Banji;
import com.situ.web.entity.Course;
import com.situ.web.entity.PageBean;
import com.situ.web.entity.Student;
import com.situ.web.service.IBanjiService;
import com.sun.prism.Texture;

public class BanjiServiceImpl implements IBanjiService{
	private IBanjiDao banjiDao = new BanjiDaoImpl();

	@Override
	public List<Banji> selectAll() {
		List<Banji> list = banjiDao.selectAll();
		return list;
	}

	@Override
	public List<Banji> search(String name) {
		return banjiDao.search(name);
	}

	@Override
	public boolean insert(Banji banji) {
		int count = banjiDao.insert(banji);
		return count == 1 ? true : false;
	}

	@Override
	public boolean update(Banji banji) {
		int count = banjiDao.update(banji);
		return count == 1 ? true : false;
	}

	@Override
	public boolean deleteById(Integer id) {
		int count = banjiDao.deleteById(id);
		return count == 1 ? true : false;
	}

	@Override
	public PageBean pageList(Integer pageNo, Integer pageSize) {
		
		return null;
	}

	@Override
	public Banji selectById(int id) {
		return banjiDao.selectById(id);
	}

	@Override
	public boolean checkName(String name) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public List<Map<String, Object>> selectBanjiCourseInfo() {
		return banjiDao.selectBanjiCourseInfo();
	}

	@Override
	public List<Course> selectCourse() {
		List<Course> list = banjiDao.selectCourse();
		return list;
	}

	@Override
	public boolean chooseCourse(int classId, int courseId) {
		int count = banjiDao.chooseCourse(classId,courseId);
		return count == 1 ? true : false;
	}

}
